﻿package com.tudou.home.newskin.containers
{
    import com.tudou.home.common.button.*;
    import com.tudou.home.common.events.*;
    import com.tudou.home.newskin.events.*;
    import com.tudou.home.newskin.interfaces.*;
    import com.tudou.skin.*;

    public class VideoSize extends PrevNextButton implements IVideoSize, IShowWidthHeight
    {

        public function VideoSize()
        {
            super(new LessSizeBTN(), new DisableLessSizeMC(), new MoreSizeBTN(), new DisableMoreSizeMC());
            previous.x = 0;
            next.x = previous.width;
            setLength(4);
            setVideoSize(VideoSizeType.NORMAL);
            this.addEventListener(PrevNextEvent.PREVIOUS, prevNextHlr);
            this.addEventListener(PrevNextEvent.NEXT, prevNextHlr);
            return;
        }// end function

        public function setVideoSize(param1:int) : void
        {
            setIndex(param1);
            return;
        }// end function

        public function get showHeight() : uint
        {
            return height;
        }// end function

        private function prevNextHlr(event:PrevNextEvent) : void
        {
            var _loc_2:int = 0;
            if (event.type == PrevNextEvent.PREVIOUS)
            {
                _loc_2 = event.index - 1;
            }
            else
            {
                _loc_2 = event.index + 1;
            }
            dispatchEvent(new SkinEvent(SkinEvent.SET_VIDEO_SIZE, _loc_2));
            return;
        }// end function

        public function get showWidth() : uint
        {
            return width;
        }// end function

        public function getVideoSize() : int
        {
            return getIndex();
        }// end function

    }
}
